package com.huaxin.device.dto.response;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

@Data
public class EquipmentStatsRespDTO {
    @Schema(description = "设备总数", example = "100")
    private long total;

    @Schema(description = "设备状态统计", example = "{\"normal\": 50, \"fault\": 20, \"maintenance\": 10, \"repair\": 5, \"offline\": 5}")
    private StatusCount statusCount;

    @Schema(description = "即将到期维保数量（如：7天内）", example = "10")
    private int maintenanceDueCount;

    @Schema(description = "设备类别统计", example = "[{\"name\": \"类别1\", \"value\": 50}, {\"name\": \"类别2\", \"value\": 20}]")
    private List<CategoryCount> byCategory;

    @Data
    public static class StatusCount {
        @Schema(description = "正常数量", example = "50")
        private int normal;

        @Schema(description = "故障数量", example = "20")
        private int fault;

        @Schema(description = "保养数量", example = "10")
        private int maintenance;

        @Schema(description = "维修数量", example = "5")
        private int repair;

        @Schema(description = "离线数量", example = "5")
        private int offline;
    }

    @Data
    public static class CategoryCount {
        @Schema(description = "设备类别名称", example = "类别1")
        private String name;

        @Schema(description = "设备类别数量", example = "50")
        private long value;
    }
}
